package ag.ui;

import ag.AGContext;
import ag.AGModel;
import ag.AGModelFrame;
import android.graphics.RectF;

public class AGBox extends AGControl {
	public AGModel _backgroundModel;
	
	public AGBox(AGModel model, int width, int height){
		super();
		
		this._backgroundModel = model;
		this.setWidth(width);
		this.setHeight(height);
	}
	
	protected void onRender(AGContext context){
		AGModelFrame frame = this._backgroundModel.getDefaultAction()
				.getDefaultDirection().getFrame(0);
		RectF actualRect = this.getActualRect();
		context.getGDI().drawTexture(actualRect, frame.getTexture(), frame.getSrcRect());
	}
}
